/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

/**
 *
 * @author ZSQ
 */
/**
 * Sigmoid激活函数实现
 * 由基础组件与数据工程师实现
 */

public class Sigmoid implements ActivationFunction {
    @Override
    public double calculate(double value) {
        return 1.0 / (1.0 + Math.exp(-value));
    }
    
    @Override
    public double derivative(double value) {
        double sigmoid = calculate(value);
        return sigmoid * (1 - sigmoid);
    }
}